﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CreateWorkingReport.aspx.cs" Inherits="pages_WorkingReport_CreateWorkingReport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>工作日志</title>
    <link href="<%=Page.ResolveUrl("~/") %>css/style.css" rel="stylesheet" type="text/css"/> 
    <style type="text/css">
    <!--
    body {
	    margin-left: 0px;
	    margin-top: 0px;
	    margin-right: 0px;
	    margin-bottom: 0px;

    }-->
    </style>
</head>
<script language="javascript" type="text/javascript">  
  function checkin(){
    var now = window.document.getElementById('hfdStartTime');
    var memo = window.document.getElementById('txtMemo'); 
    if(now.value>"08:30"){
       if(memo.value==""){
          alert("请填写备注信息!");
          return false;
       }
    }
  }
  function checkvalue() {     
    var startTime = window.document.getElementById('txtStartTime'); 
    var endTime = window.document.getElementById('txtEndTime');
    var workDescription = window.document.getElementById('txtWorkDescription');
    
    if (startTime.value=="") {
      alert("请输入开始时间，格式为08:30");      
      return false;
     }
     
    //(([0-1][0-9])|([2][0-3])):([0-5][0-9])   
                                   
     if (!startTime.value.match(/([01][0-9]|2[0-9]).*([0-5][0-9])/)) {                   
         alert("开始时间格式不正确!格式为08:30");
         return false;
     } 
     
     if (endTime.value=="") {
      alert("请输入结束时间，格式为08:30");      
      return false;
     }    

    if (!endTime.value.match(/([01][0-9]|2[0-9]).*([0-5][0-9])/)) {
    
         alert("结束时间格式不正确!格式为08:30");
         return false;
     
     }        
    
    if(endTime.value<=startTime.value){
       alert("结束时间不能小于等开始时间！");
       return false;
    }

    if (workDescription.value=="") {
      alert("请输入工作描述");      
      return false;
     }  
    else if (workDescription.value.length>400) {
      alert("工作描述请在400个字符或者200个汉字之内");      
      return false;
     }  
     

  }   
</script>

<body>
<form id="form1" runat="server">
    <asp:HiddenField ID="hfdStartTime" runat="server" />
    <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
        <tr height="25">
           <td class="top_navigator">
               &nbsp;&nbsp;<asp:Image ID="Image1" runat="server" ImageUrl="~/images/navi-home.gif" ImageAlign="Bottom"/>&nbsp;个人办公
               <asp:Image ID="Image2" runat="server" ImageUrl="~/images/navi-sep.gif" ImageAlign="Bottom"/>&nbsp;工作日志
           </td>  
           <td class="top_buttons_td">
               <asp:Button ID="btnSaveWorkingReport" runat="server"  Text="保存" class="button_sky" OnClick="btnSaveWorkingReport_Click" />
           </td>  
        </tr>
    </table>
    
    
   <br/>
   <table cellpadding="1" cellspacing="1" class="tableHome" align="center" width="96%" >
        <caption>
			出勤登记
		</caption>
     <tr height="20px" align="center">
       <th width="13%" valign="middle">日期</th>
       <th width="13%" valign="middle">登录类型</th>
       <th width="15%" valign="middle">规定时间</th>
       <th width="15%" valign="middle">登记时间</th>
       <th width="13%" valign="middle">登记</th>
       <th width="13%" valign="middle">备注</th>       
    </tr>
      <tr height="20px" align="center">
        <td rowspan="2" ><asp:Label ID="lblDateNow" runat="server"></asp:Label></td>
        <td >上班</td>
        <td >08:30</td>
        <td ><asp:Label ID="lblCheckInDate" runat="server"></asp:Label></td>
        <td ><asp:Button ID="btnCheckIn" runat="server" OnClick="CheckIn_Click" Text="上班登记" class="button_sky" /><asp:Label ID="lblCheckIn" runat="server"></asp:Label></td>
        <td rowspan="2" align="left">
           <asp:TextBox ID="txtMemo" runat="server" Rows="2" TextMode="MultiLine" Width="240px"></asp:TextBox>
      </tr>
      <tr height="20px" align="center">
        <td >下班</td>
        <td >17:30</td>
        <td ><asp:Label ID="lblCheckOutDate" runat="server"></asp:Label></td>
        <td ><asp:Button ID="btnCheckOut" runat="server" OnClick="CheckOut_Click" Text="下班登记" class="button_sky" /><asp:Label ID="lblCheckOut" runat="server"></asp:Label></td>
      </tr>  
    </table>    

   <br/><br/>
   <table cellpadding="1" cellspacing="1" class="tableHome" align="center" width="96%">
      <tr>
        <th>今日工作</th>
        <th>知识积累</th>
        <th>明日计划</th>
      </tr>
      <tr>
        <td align="center" style="height: 58px"><asp:Label ID="lblTodayWork" runat="server" Width="280px" Height="48px" BorderColor="#006699" BorderStyle="Solid" BorderWidth="1px" style="text-align:left"></asp:Label></td>
        <td align="center" style="height: 58px"><asp:TextBox ID="txtKnowledge" runat="server" Rows="3" TextMode="MultiLine" Width="250px"></asp:TextBox></td>
        <td align="center" style="height: 58px"><asp:TextBox ID="txtPlan" runat="server" Rows="3" TextMode="MultiLine" Width="250px"></asp:TextBox></td>
      </tr>
    </table>
    <br/><br/>
    
    <div style="text-align:center">
      <asp:GridView ID="GridViewWorkingReport" runat="server" AutoGenerateColumns="False"
          CellPadding="0" ForeColor="#333333" GridLines="None" Width="96%"    OnRowDeleting="GridViewWorkingReport_RowDeleting" CssClass="tableGrid" EmptyDataText="当前没有记录。" SkinID="gridviewSkin" Caption="工作日志明细" Font-Size="9pt"  >
          <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
          <Columns>
              <asp:BoundField DataField="start_time"  HeaderText="开始时间" />             
              <asp:BoundField DataField="end_time"  HeaderText="结束时间" />
              <asp:BoundField DataField="work_time" DataFormatString="{0:F1}" HtmlEncode="False" HeaderText="时长(小时)" />              
              <asp:BoundField DataField="working_type_name"  HeaderText="工作类型">
                  <ItemStyle HorizontalAlign="Left" />
              </asp:BoundField>
              <asp:BoundField DataField="cost_name"  HeaderText="成本项">
                  <ItemStyle HorizontalAlign="Left" />
              </asp:BoundField>                          
              <asp:BoundField DataField="work_description" HeaderText="工作描述">
                  <ItemStyle HorizontalAlign="Left" Width="50%" />
              </asp:BoundField>
              <asp:CommandField ShowDeleteButton="True" HeaderText="操作"/>
          </Columns>
          <RowStyle BackColor="#F8F8F8" Height="20px" />
          <EditRowStyle BackColor="#2461BF" />
          <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
          <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
          <AlternatingRowStyle BackColor="White" />
          <HeaderStyle Font-Bold="True" ForeColor="White" Height="20px" />
          <EmptyDataRowStyle BackColor="#E0E0E0" />
      </asp:GridView>
    </div>
    <br/><br/>
      <table cellpadding="1" cellspacing="1" class="tableHome" align="center" width="96%">
      <tr>
        <th width="10%">开始时间</th>
        <th width="10%">结束时间</th>
        <th width="10%">工作类型</th>
        <th width="9%">成本项</th>
        <th>工作描述</th>
      </tr>
      <tr >
        <td width="10%" style="height: 38px" valign="middle" align="center">
            <asp:TextBox ID="txtStartTime" runat="server" Width=70></asp:TextBox>
        </td>
        <td width="10%" style="height: 38px" valign="middle" align="center">
            <asp:TextBox ID="txtEndTime" runat="server" Width=70></asp:TextBox>
        </td>
        <td width="10%" style="height: 38px" align="center">
            <asp:DropDownList ID="DropDownWorkType" runat="server" AutoPostBack="True" >
            </asp:DropDownList>            
        </td>
        <td width="9%" style="height: 38px" align="center">
            <asp:DropDownList ID="DropDownWorkCost" runat="server">
            </asp:DropDownList></td>
        <td style="height: 38px" align="center">
            <asp:TextBox ID="txtWorkDescription" runat="server" Rows="2" TextMode="MultiLine" Width="420px"></asp:TextBox>&nbsp;
         </td>     
      </tr>
      <tr >        
        <td colspan="6" class="div_right">
            <asp:Button ID="btnAddWorkReport" runat="server" Text="添加到日志" class="button_sky" OnClick="btnAddWorkReport_Click"/>
        </td>
       </tr>
     </table>
       
    </form>
</body>
</html>
